Page({
    data: {
        imgList: [],
        indicatorDots: false,
        autoplay: '',
        interval: 5000,
        duration: 1000,
        currentArea: '广州',
        indexNavList: [
        ],
        // 推荐列表
        recommendList: [{
                id: "0001",
                headImg: "../../images/index/01.jpg",
                name: "草莓妹妹",
                sex: 1,
                charmValue: 200,
                city: "广州",
                area: "天河",
                age: 24
            },
            {
                id: "0002",
                headImg: "../../images/index/02.jpg",
                name: "草莓妹妹",
                sex: 2,
                charmValue: 200,
                city: "广州",
                area: "白云",
                age: 24
            },
            {
                id: "0003",
                headImg: "../../images/index/02.jpg",
                name: "草莓妹妹",
                sex: 2,
                charmValue: 200,
                city: "广州",
                area: "白云",
                age: 24
            },
            {
                id: "0004",
                headImg: "../../images/index/01.jpg",
                name: "草莓妹妹",
                sex: 2,
                charmValue: 200,
                city: "广州",
                area: "白云",
                age: 24
            }
        ],
        // 附近列表
        nearbyList: [{
                id: "0001",
                headImg: "../../images/index/01.jpg",
                name: "草莓妹妹",
                sex: 1,
                charmValue: 200,
                city: "广州",
                area: "天河",
                age: 24,
                distance: 500
            },
            {
                id: "0002",
                headImg: "../../images/index/02.jpg",
                name: "草莓妹妹",
                sex: 1,
                charmValue: 200,
                city: "广州",
                area: "天河",
                age: 24,
                distance: 800
            },
            {
                id: "0003",
                headImg: "../../images/index/01.jpg",
                name: "草莓妹妹",
                sex: 1,
                charmValue: 200,
                city: "广州",
                area: "天河",
                age: 24,
                distance: 500
            },
            {
                id: "0004",
                headImg: "../../images/index/01.jpg",
                name: "草莓妹妹",
                sex: 1,
                charmValue: 200,
                city: "广州",
                area: "天河",
                age: 24,
                distance: 500
            }
        ],
        indexContentNav: {
            index: 0,
            indexContenNavtLeftStyle: "index-content-navOne index-content-navLeft",
            indexContenNavtRightStyle: "index-content-navOne"
        }

    },

    indexContentNavOne: function() {
        var that = this
        if (that.data.indexContentNav.index === 1) {
            that.setData({
                indexContentNav: {
                    index: 0,
                    indexContenNavtLeftStyle: "index-content-navOne index-content-navLeft",
                    indexContenNavtRightStyle: "index-content-navOne"
                }
            })
        }
    },
    indexContentNavTwo: function() {
        var that = this
        if (that.data.indexContentNav.index === 0) {
            that.setData({
                indexContentNav: {
                    index: 1,
                    indexContenNavtLeftStyle: "index-content-navOne",
                    indexContenNavtRightStyle: "index-content-navOne  index-content-navRight"
                }
            })
        }
        console.log(that.data.indexContentNav)
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
		var that = this
        wx.request({
            url: 'https://s.yougou520.cn/api/home/home',
            success: function(res) {
				var data = res.data.data
				console.log(data)
				that.setData({
					autoplay: data.autoplay,
					indicatorDots: data.indicatorDots,
					interval: data.interval,
					duration: data.duration,
					imgList: data.imglist,
					indexNavList: data.indexnavlist
				})
            }
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function() {

    }
})